package com.wust.smartcity.admin.server.core.api.feign.server;

import com.wust.smartcity.admin.server.core.dao.SysImportExportMapper;
import com.wust.smartcity.common.annotations.FeignApi;
import com.wust.smartcity.common.dto.WebResponseDto;
import com.wust.smartcity.common.entity.sys.importexport.SysImportExport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author ：wust
 * @date ：Created in 2019/9/7 10:24
 * @description：内部系统调用的接口
 * @version:
 */
@FeignApi
@RequestMapping("/api/feign/v1/ImportExportFeignApi")
@RestController
public class ImportExportFeignApi {
    @Autowired
    private SysImportExportMapper sysImportExportMapper;

    @RequestMapping(value = "/insert",method= RequestMethod.POST)
    public WebResponseDto insert(@RequestBody SysImportExport entity) {
        WebResponseDto responseDto = new WebResponseDto();
        int result = sysImportExportMapper.insert(entity);
        responseDto.setObj(result);
        return responseDto;
    }


    @RequestMapping(value = "/selectOne",method= RequestMethod.POST)
    public WebResponseDto selectOne(@RequestBody SysImportExport search) {
        WebResponseDto responseDto = new WebResponseDto();
        SysImportExport sysImportExport = sysImportExportMapper.selectOne(search);
        responseDto.setObj(sysImportExport);
        return responseDto;
    }


    @RequestMapping(value = "/updateByPrimaryKeySelective",method= RequestMethod.POST)
    public WebResponseDto updateByPrimaryKeySelective(@RequestBody SysImportExport entity) {
        WebResponseDto responseDto = new WebResponseDto();
        int count = sysImportExportMapper.updateByPrimaryKeySelective(entity);
        responseDto.setObj(count);
        return responseDto;
    }
}
